﻿using System;
using System.Collections.Generic;
using System.Text;

namespace daSyntaxAnalyser.SyntaxTree
{
    using daBase.Objects;

    public class ExportByElement : SyntaxTreeElement
    {
        private TokenInfo option;
        private ConstExpressionElement value;
        bool resident;

        public TokenInfo Option { get { return option; } set { option = value; } }
        public ConstExpressionElement Value { get { return value; } set { this.value = value; } }
        public bool Resident { get { return resident; } set { resident = value; } }

        public ExportByElement(TokenInfo Option, ConstExpressionElement Value, bool Resident, List<TokenInfo> Comments)
            : base(Option, Comments)
        {
            option = Option;
            value = Value;
            resident = Resident;
        }

        public override string ToString()
        {
            return string.Format("{0} {1}{2}", option, value, (resident) ? " resident" : string.Empty);
        }

        protected override IEnumerator<ISyntaxTreeElement> CreateEnumerator()
        {
            yield return value;
        }
    }
}
